<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>新增额度</title>
    <jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div id="pageInTab" class="pageInTab">
        <div tabid="tabA" title="基本信息" lselected="true">
            <form id="formSet1">
            	<div class="fieldset1 tabel_col clearFix">
					<div class="caption">
                        <span class="title">基本信息</span>
                    </div>
					<div class="fieldBox col_50">
						<div class="label">事业部</div>
						<div class="field">
							<input type="text" id="buOrgCd" name="buOrgCd" ltype="combobox" placeholder="请选择"/>
							<input type="hidden" id="buOrgCdNm" name="buOrgCdNm" value="${quatoBscInfoVO.buOrgCdNm}"/>
						</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">项目类型</div>
						<div class="field">
							<%--<select multiple  name="prjTypCd" id="prjTypCd" data-value=""  validate="{required:true}" >
								<option value="" checked >请选择</option>
								<c:forEach items="${prjTypCdList }" var="kv">
									<option value="${kv.key }" >${kv.value }</option>
								</c:forEach>
							</select>--%>
								<input type="text" id="prjTypCd" name="prjTypCd" ltype="combobox" placeholder="请选择"/>
								<input type="hidden" id="prjTypCdNm" name="prjTypCdNm" value="${quatoBscInfoVO.prjTypCdNm}"/>
						</div>
					</div>
					<div class="fieldBox col_100">
						<div class="label">备注</div>
						<div class="field">
							<textarea name="remark" id="remark" rows="4" class="l-textarea" style="width:300px" maxlength="500"
									  value="" validate="{required:false,maxlength:500}"></textarea>
						</div>
					</div>
				</div>
	            <div class="btnsBox">
	                <span id="saveBtn1" class="sq-button sq-button-round">保存</span>
                    <input name="id" id="id" type="hidden" value="${id }">
	            </div>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">
    var loadedTabs=[];
    var mfrRlPsnGrid;
    var isFlow = '${isFlow}';
    var isModify = '${isModify}';
    var isMdfPayTyp = '${isMdfPayTyp}';
    var mfrId = '${id}';
    var isCheckVerify = '${isCheckVerify}';
    var isDetail = '${isDetail}';

    $(function(){
		//项目类型
		var _prjTypCdListJSON = ${prjTypCdList};
		var data = ${quatoBscInfoJSON};
		var data1 = ${quatoBscInfoVO};
		console.log(data);
		console.log(data1);
		$("#prjTypCd").ligerComboBox({ isShowCheckBox: true, isMultiSelect: true,
			data: _prjTypCdListJSON,
			valueField: 'key',
			textField:'value'
		});

		$("#prjTypCd").ligerGetComboBoxManager().selectValue(data.prjTypCd);
		$("#prjTypCd").ligerGetComboBoxManager().updateStyle();

		//事业部
		var _buOrgCdListJSON = ${buOrgCdList};
		$("#buOrgCd").ligerComboBox({ isShowCheckBox: true, isMultiSelect: true,
			data: _buOrgCdListJSON,
			valueField: 'key',
			textField:'value'
		});

		$("#buOrgCd").ligerGetComboBoxManager().selectValue(data.buOrgCd);
		$("#buOrgCd").ligerGetComboBoxManager().updateStyle();

        $("#saveBtn1").click(function(event) {

            var data = {};
            var url='<%=path%>/quato/quatoBscInfo/modifyPrjTypCd.do';
			console.log($("#id").val());
			data["id"] = $("#id").val();//id
			data["prjTypCd"] = $('#prjTypCd_val').val();//项目类型
            data["prjTypCdNm"] = $("#prjTypCdNm").val();//修改前项目类型名称
            data["afterPrjTypCdNm"] = $("#prjTypCd").val();//修改后项目类型名称
			data["buOrgCd"] = $('#buOrgCd_val').val();//事业部
            data["buOrgCdNm"] = $("#buOrgCdNm").val();//修改前事业部名称
            data["afterBuOrgCdNm"] = $("#buOrgCd").val();//修改后事业部名称
            data["remark"] = $("#remark").val();//备注

            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType:'json',
                data:data,
                url: url,
                beforeSend: function(){
                    wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
                },
                success:function(msg){
                    wait_dialog.close();
                    if(msg.success == 1){
                        $.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
						frameElement.dialog.close();
                    }else{
                        $.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                    }
                }
            })
        })
    })
</script>



</body>
</html>
